package edu.pku.sei.transformation.qvt.adapter.mediniqvt;

import java.util.ArrayList;

import edu.pku.sei.transformation.editor.model.AtomicTransformation;
import edu.pku.sei.transformation.editor.model.Rule;
import edu.pku.sei.transformation.qvt.adapter.standardqvt.RelationAdapter;
import edu.pku.sei.transformation.qvt.adapter.standardqvt.TransformationAdapter;
import edu.pku.sei.transformation.qvt.rule.IRelation;

public class MediniQVTTransformationAdapter extends TransformationAdapter {

	public MediniQVTTransformationAdapter(AtomicTransformation t) {
		super(t);
	}
	
	@Override
	protected void addRelations() {
		relations = new ArrayList<IRelation>();
		for (Object obj : this.element.getRules()) {
			if (obj instanceof Rule) {
				IRelation r = new MediniQVTRelationAdapter((Rule) obj);
				r.setOwner(this);
				relations.add(r);
			}
		}
	}

}
